<template>
  <div class="left-container">
    <h3>Left 组件</h3>
    <div>我是父组件传递过来的值 {{msg}}</div>
    <div>{{ num }}</div>
    <button @click="btnClick">按钮</button>
  </div>
</template>

<script>
import bus from '@/utils/bus'

export default {
  name: 'MyLeft',
  props: {
    msg: String
  },
  data () {
    return {
      num: 1
    }
  },
  methods: {
    btnClick () {
      this.num++
      this.$emit('getNum', this.num)
      bus.$emit('getBus', this.num)
    }
  }
}
</script>

<style lang="scss">
.left-container {
  padding: 0 20px 20px;
  background-color: orange;
  min-height: 250px;
  flex: 1;
}
</style>
